#!/bin/csh -x
setenv ENGINE_HOME $HOME
setenv RDAHMM_HOME $ENGINE_HOME/projects/tmp/bin
#setenv DATA_HOME $ENGINE_HOME/tmp/scenario
setenv DATA $1.xyz
setenv N $2
setenv RSEED $3
setenv NTRY $4

cat $1 | awk '{print $4,$5,$6}'  > $1.xyz
cat $1 | awk '{print $3}' | sed -n '1p'| sed '/^$/d' > $1.xyz.starttime
cat $1 | awk '{print $3}' | sed -n '$p'| sed '/^$/d' > $1.xyz.endtime

setenv T `wc -l < $DATA`
setenv DT `wc -w < $DATA`
setenv D `echo $DT / $T | bc`

echo "T=$T DT=$DT D=$D"

$RDAHMM_HOME/rdahmm -data $DATA -T $T -D $D -N $N -output_type gauss -anneal -annealfactor 1.1 -betamin 0.1 -regularize -omega 0 0 1 1.0e-6 -ntries $NTRY -seed $RSEED
